<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use frontend\assets\AppAsset;
$this->title = '注册';
$this->params['breadcrumbs'][] = $this->title;

$fieldOptions1 = [
    'options' => ['class' => 'positionr'],
    'inputTemplate' => "{input}<p class=\"error0\">输入正确的11位手机号码</p><p class=\"error1\">该手机号码已经注册</p><p class=\"error2\">请输入您的手机号码</p>"
];

$fieldOptions2 = [
    'options' => ['class' => 'positionr'],
    'inputTemplate' => "{input}<input class=\"inlineBlock getCode\" value ='获取验证码' type='button' style='width: 110px;height:43px;float:right;font-size:14px;' readonly><p class=\"error3\">验证码错误，请重新输入</p><p class=\"error4\">请输入正确的短信验证码</p>"
];

$fieldOptions3 = [
    'options' => ['class' => 'positionr'],
    'inputTemplate' => "{input}<p class=\"passwordError\">密码格式为6-20位字符</p>"
];
$fieldOptions4 = [
    'options' => ['class' => 'positionr'],
    'inputTemplate' => "{input}<p class=\"passwordError\">两次输入的密码不一致</p>"
];
?>

  <div class="login registerStep1">
    <div class="main">
      <div class="content-wrap">
        <div class="navs">
          <ul class="list">
            <li class="current">验证手机<span class="stepNumber inlineBlock">1</span></li>
            <li>设置密码<span class="stepNumber inlineBlock">2</span></li>
            <li>注册成功<span class="stepNumber inlineBlock">3</span></li>
          </ul>
        </div>
        <div class="registArea">
          <div class="item">

            <?php $form = ActiveForm::begin(['method'=>'post']);?>

                <!-- //用于阻止 from表单自动填充的占位符 -->
                <input  type="text"  style="display:none;"/>
                <input  type="password" style="display:none;"/>
                <input  type="password" style="display:none;"/>
                <!-- //用于阻止 from表单自动填充的占位符 -->
              <?= $form
                ->field($model, 'phone',$fieldOptions1)
                ->label(false)->error(false)
                ->textInput(['maxlength' => 11,'placeholder'=>'请输入手机号码','class'=>'phoneNum','onkeyup'=>"this.value=this.value.replace(/\D/g,'')",'autocomplete'=>'off']) ?>

              <?= $form
                ->field($model, 'code',$fieldOptions2)
                ->label(false)->error(false)
                ->textInput(['maxlength' => 6,'placeholder'=>'请输入手机收到的验证码','class'=>'codeInput','onkeyup'=>"this.value=this.value.replace(/\D/g,'')",'autocomplete'=>'off']) ?>
              
              <p><span class="inlineBlock registerNext nextbtn">下一步</span></p>

              <p class="subTxt">已有账号？<a href="/site/login">登录</a></p>
          </div>

          <div class="item">
            <p class="tt0">您的手机号为：<span id="vary_phone">18356195139</span></p>
            <!-- //用于阻止 from表单自动填充的占位符 -->
            <input  type="text"  style="display:none;"/>
            <input  type="password" style="display:none;"/>
            <input  type="password" style="display:none;"/>
            <!-- //用于阻止 from表单自动填充的占位符 -->
            <?= $form
                ->field($model, 'password',$fieldOptions3)
                ->label(false)->error(false)
                ->passwordInput(['maxlength' => 20,'autocomplete'=>'off','placeholder'=>'请设置您的密码','class'=>'password1']) ?>

            <?= $form
                ->field($model, 'password2',$fieldOptions4)
                ->label(false)->error(false)
                ->passwordInput(['maxlength' => 20,'autocomplete'=>'off','placeholder'=>'请再次输入密码','class'=>'password2']) ?>

            <?= Html::submitButton('完成注册', ['class' => 'inlineBlock completeRegist nextbtn']) ?>

            <p class="txt1">点击“完成注册”，即表示您同意并愿意遵守<a href="javascript:void(0)">添品网用户注册协议</a></p>
          </div>

            <?php ActiveForm::end(); ?>

        </div>
      </div>
    </div>
    <div class="mask"></div>
    <div class="regist01Pop">
      <p class="tt1">请输入右侧图中的二维码</p>
      <div class="code positionr">
        <input type="text" placeholder="图片验证码" class="errorBor">
        <img src="" alt="" class="codes">
        <p class="error5">请输入验证码</p>
        <!--验证码错误，请重新输入-->
      </div>
      <p class="confirmBox"><span class="inlineBlock confirmBtn">确定</span></p>
    </div>
  </div>
<style type="text/css">
  .nextbtn{border:0;font-size: 16px;}/*
  .layui-layer-content{padding: 12px 25px;text-align: center;}
  #layui-layer1{width: 240px}*/
</style>
<?php
$this->registerJsFile('/js/reg.js');
?>